/*
 * @(#)Cracker.java    Apr 12, 2010
 *
 * Copyright 2009 Nyber Shanghai, Inc. All rights reserved.
 */

package com.lab.io;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;

/**
 * Class description goes here.
 *
 * @author nickevin@gmail.com
 * @version Apr 12, 2010 4:57:15 PM
 */

public class ReadByUrl {

	public static void main(String[] args) throws Exception {
		URL url = new URL("http://www.163.com/");
		URLConnection connection = url.openConnection();
		BufferedReader is = new BufferedReader(new InputStreamReader(connection
				.getInputStream(), "UTF-8"));

		String c = "";
		StringBuilder sb = new StringBuilder();
		while ((c = is.readLine()) != null) {
			sb.append(c).append("\n");
		}

		System.out.println(sb.toString());
	}
}